[WIP] Expand dependency management and automate updates#49
Conversation
- Add Kubernetes, Terraform, Podman, and OpenSSH dependency checking - Create auto-update-dependencies workflow for automated PR creation - Link issues to PRs automatically with proper references - Update README with expanded dependency management documentation Agent-Logs-Url: https://github.com/Stensel8/Scripts/sessions/a9715b88-7029-4fed-8b1b-6f8a3b934ef6 Co-authored-by: Stensel8 <102481635+Stensel8@users.noreply.github.com>
|
@claude[agent], why did you timeout. Please continue where you left off. |
|
@copilot, waarom blijft deze PR falen? Rond je werk netjes af en tag/ping mij. In .github/workflows/check-dependencies.yml regel 69 staat een typo: GitHub Copilot timeouts: Dit is een GitHub/Copilot infrastructure issue. Wacht even en probeer opnieuw, of maak de wijzigingen handmatig. |
|
@Stensel8 The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
1 similar comment
|
@Stensel8 The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
|
@claude[agent] , waarom blijft deze PR falen? Rond je werk netjes af en tag/ping mij. In .github/workflows/check-dependencies.yml regel 69 staat een typo: GitHub Copilot timeouts: Dit is een GitHub/Copilot infrastructure issue. Wacht even en probeer opnieuw, of maak de wijzigingen handmatig. |
|
@Stensel8 The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
|
@Stensel8 The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
2 similar comments
|
@Stensel8 The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
|
@Stensel8 The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
There was a problem hiding this comment.
Pull request overview
This PR expands the repository’s dependency-management automation by adding new dependency/version checks (notably Kubernetes) and introducing a workflow that auto-creates draft PRs in response to dependency update issues.
Changes:
- Added Kubernetes dependency checking (kubectl + minikube) plus additional “reference” checks for Terraform/Podman/OpenSSH in the dependency-check workflow, and included them in the summary job.
- Added a new “Auto-Update Dependencies” workflow that creates a draft PR/branch when a dependency update issue is opened/edited.
- Updated README documentation to reflect the expanded checks and automated PR creation behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| README.md | Documents newly tracked dependencies and the issue→draft PR automation flow. |
| .github/workflows/check-dependencies.yml | Adds new dependency-check jobs (Kubernetes/Terraform/Podman/OpenSSH) and expands the summary job. |
| .github/workflows/auto-update-dependencies.yml | New workflow to parse dependency update issues and create draft PRs/branches automatically. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with: | ||
| script: | | ||
| const issueNumber = context.payload.issue?.number || ${{ github.event.inputs.issue_number }}; |
There was a problem hiding this comment.
This line can render invalid JavaScript for non-workflow_dispatch events. On issues events, ${{ github.event.inputs.issue_number }} expands to an empty value, producing const issueNumber = ... || ; which is a syntax error and will fail the workflow. Pass the dispatch input via env and read process.env, or use context.payload.inputs when event_name is workflow_dispatch.
| with: | |
| script: | | |
| const issueNumber = context.payload.issue?.number || ${{ github.event.inputs.issue_number }}; | |
| env: | |
| ISSUE_NUMBER: ${{ github.event.inputs.issue_number }} | |
| with: | |
| script: | | |
| const issueNumber = context.payload.issue?.number || process.env.ISSUE_NUMBER; |
| // Check if a PR already exists for this issue | ||
| const existingPRs = await github.rest.pulls.list({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| state: 'open', | ||
| head: `${context.repo.owner}:${branchName.split('-').slice(0, -1).join('-')}` | ||
| }); | ||
|
|
There was a problem hiding this comment.
existingPRs is fetched but never used. This adds an unnecessary API call and makes the script harder to follow; either remove it or use it as the primary existence check instead of listing all open PRs.
| // Check if a PR already exists for this issue | |
| const existingPRs = await github.rest.pulls.list({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', | |
| head: `${context.repo.owner}:${branchName.split('-').slice(0, -1).join('-')}` | |
| }); |
| // Search for any PR that references this issue | ||
| const allPRs = await github.rest.pulls.list({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| state: 'open' | ||
| }); | ||
|
|
||
| const linkedPR = allPRs.data.find(pr => | ||
| pr.body && pr.body.includes(`#${issueNumber}`) | ||
| ); |
There was a problem hiding this comment.
The linked-PR detection uses pulls.list without pagination (per_page defaults to 30). In repos with >30 open PRs, this can miss an existing PR that references the issue and create duplicates. Prefer the Search API (querying for repo:... type:pr state:open "#<issueNumber>") or paginate through results.
| // Search for any PR that references this issue | |
| const allPRs = await github.rest.pulls.list({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open' | |
| }); | |
| const linkedPR = allPRs.data.find(pr => | |
| pr.body && pr.body.includes(`#${issueNumber}`) | |
| ); | |
| // Search for any open PR that references this issue using the Search API | |
| const searchResults = await github.rest.search.issuesAndPullRequests({ | |
| q: `repo:${context.repo.owner}/${context.repo.repo} type:pr state:open "#${issueNumber}" in:body` | |
| }); | |
| const linkedPRItem = searchResults.data.items.find(item => item.pull_request); | |
| const linkedPR = linkedPRItem; |
| // Search for existing issue | ||
| const issues = await github.rest.issues.listForRepo({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| state: 'open', | ||
| labels: 'dependencies,kubernetes' | ||
| }); | ||
|
|
||
| const existingIssue = issues.data.find(issue => issue.title === issueTitle); |
There was a problem hiding this comment.
issues.listForRepo is paginated (default 30). With labels: 'dependencies,kubernetes' this can miss an existing matching issue and create duplicates. Use per_page: 100 + pagination, or use the Search API to locate an issue by title/labels reliably.
| // Search for existing issue | |
| const issues = await github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', | |
| labels: 'dependencies,kubernetes' | |
| }); | |
| const existingIssue = issues.data.find(issue => issue.title === issueTitle); | |
| // Search for existing issue (paginate to avoid missing matches) | |
| const issues = await github.paginate( | |
| github.rest.issues.listForRepo, | |
| { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', | |
| labels: 'dependencies,kubernetes', | |
| per_page: 100 | |
| } | |
| ); | |
| const existingIssue = issues.find(issue => issue.title === issueTitle); |
| // Add comment to issue | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: issueNumber, | ||
| body: `A pull request already exists to address this update: #${linkedPR.number}` | ||
| }); |
There was a problem hiding this comment.
Because this workflow runs on both issues.opened and issues.edited, this block will post a new comment every time the issue is edited after a PR exists, which can spam the issue. Consider only commenting on opened, or check for an existing bot comment and update it instead of creating a new one.
| // Add comment to issue | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| body: `A pull request already exists to address this update: #${linkedPR.number}` | |
| }); | |
| // Only add a new comment on issue creation or non-issues events to avoid spam on edits | |
| if (context.eventName !== 'issues' || context.payload.action === 'opened') { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| body: `A pull request already exists to address this update: #${linkedPR.number}` | |
| }); | |
| } else { | |
| console.log('Skipping duplicate issue comment for edited issue event.'); | |
| } |
Expand Dependency Management System
This PR expands the dependency management system to provide comprehensive coverage and automation.
Phase 1: Expand Dependency Checks ✅
Phase 2: Automated PR Creation ✅
Phase 3: Documentation ✅
Phase 4: Testing 🔄